﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MySql.Data.MySqlClient;
using System.Data;

namespace PTTPOS_Solution.DAL
{
    public static class Diary_DA
    {
        public static void Insert(string id_staff, string name, DateTime date)
        {
            MySqlConnection connect = Connection_PTTPOS.GetConnection();
            MySqlCommand command = new MySqlCommand("insert into tbldiary(id_staff, name, date) value(@id_staff, @name, @date)", connect);
            command.Parameters.AddWithValue("@id_staff", id_staff);
            command.Parameters.AddWithValue("@name", name);
            command.Parameters.AddWithValue("@date", date);
            command.Connection.Open();
            command.ExecuteNonQuery();
            command.Connection.Close();
        }
    }
}
